package com.itcast.springDemo.controller;

import com.itcast.springDemo.service.impl.OrderServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "/orders")
public class OrderController {
    @Autowired
    private OrderServiceImpl order;
    @RequestMapping("/update")
    public String updateOrder() throws Exception{
        System.out.println("接收前端的数据");
        System.out.println("将数据封装成对象");
        System.out.println("调用service层,将数据交给service层处理,并且得到结果");
        String result = order.updateOrder();
        System.out.println("将结果响应给前端");
        return result;
    }
}
